home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00b.txt
/
000084_icon-group-sender_Thu Oct 19 15:51:56 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9JMpXJ14175
for icon-group-addresses; Thu, 19 Oct 2000 15:51:33 -0700 (MST)
Message-Id: <200010192251.e9JMpXJ14175@baskerville.CS.Arizona.EDU>
Date: Thu, 19 Oct 2000 14:51:32 -0700 (MST)
From: Gregg Townsend <gmt>
To: icon-group
Subject: Re: Pipes in Icon
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1378
> From: "Charles Hethcoat" <CHETHCOA@oss.oceaneering.com>
>
> I would like to invoke a program /usr/bin/xyz from within an Icon program
> and use pipes to communicate with it. I would send the command strings
> to xyz with a write(), and then read the results with a read()...
>
> So the question is, is there any way to accomplish this entirely within
> Icon? I'm sure I could with C, or with a bash script.
I contend that buffering problems make this infeasible from either C or
Icon. Most I/O libraries don't write anything to a pipe until they've
filled a buffer, and the most likely consequence would be a deadlock,
with each program waiting for the other to send more data.
> From: Taybin Rutkin <trutkin@black.clarku.edu>
>
> ...What you're doing is creating a file at /usr/bin/xyz that is a pipe.
No, this is a misunderstanding of how Icon's open(..., "p") works. It
opens a pipe to a process; it doesn't create a named pipe. That does
suggest a possibile approach: You could create a named pipe (using
system("mkfifo /tmp/mypipe") or whatever) for a second channel to the
spawned process. But I still would predict deadlock.
---------------------------------------------------------------------------
Gregg Townsend Staff Scientist The University of Arizona
gmt@cs.arizona.edu Computer Science Tucson, Arizona, USA